<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="renderer" content="webkit" />
    <title>提现记录</title>
    <meta name="force-rendering" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="../css/shop.css">
    <link rel="stylesheet" href="../css/weui.min.css">
    <link rel="stylesheet" href="../css/jquery-weui.min.css">
    <script src="../js/jquery-2.1.4.js"></script>
    <script src="../js/jquery-weui.js"></script>
    <script src="../wxJs/utils/contain.js"></script>
    <script src="../wxJs/utils/storage.js"></script>
    <style>
        .order-title {
            padding: 0 15px;
            line-height: 40px;
            font-size: 14px;
            background-color: #f1f1f2;
            font-weight: 400;
        }

        .order-item {
            border-bottom: 1px solid #EBEDEF;
            padding: 10px 15px;
            background: #fff;
            align-items: center;
        }

        .top-info {
            font-size: 14px;
            font-weight: 400;
            line-height: 24px;
            color: #999
        }

        .top-info .name {
            color: #333;
            font-size: 14px;
            font-weight: bold;
        }

        .order-item .cl-main {
            font-weight: bold;
        }

        .btm-info {
            color: #999
        }

        .image-contain {
            width: 48px;
            height: 48px;
            flex-shrink: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            margin-right: 10px;
            align-content: center;
            border-radius: 50%;
            border-radius: 50%;
            background: linear-gradient(-45deg, #3978fe, #76a2ff);
            color: #fff;
            font-size: 24px;
            box-shadow: 0 0 4px #3978fe;
        }
    </style>
</head>

<body>
    <div class="header" style="display: flex">
        <div class="haader-left" href="javascript:window.history.go(-1)"></div>
        <div class="haader-content">提现记录</div>
        <div class="haader-right">
            <i class="iconfont icon-riqi"></i>&nbsp;
        </div>
    </div>
    <div id="pickList">

    </div>

</body>
<script>
    $(".icon-riqi").picker({
        onClose: function (obj) {
            var year = parseInt(obj.value[0])
            var month = parseInt(obj.value[1])
            if (month < 10) {
                month = "0" + month
            }
            var selectMonth = year + "-" + month;

            queryMonthLog(selectMonth)
        },
        title: "请选择年月",
        cols: [{
            textAlign: 'center',
            values: (function () {
                var arr = [], cur = new Date();
                for (var i = 2019; i <= cur.getFullYear(); i++) {
                    arr.push(i + "年")
                }
                return arr
            })()
            //如果你希望显示文案和实际值不同，可以在这里加一个: [.....]
        },
            {
                textAlign: 'center',
                values: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月",]
            }
        ]
    });




    var shopId = GetQueryString("shopId");
    if (!shopId) {
        window.history.back(-1);
    } else {
        var date = new Date(), y = date.getFullYear(), m = date.getMonth()+1;
        if (m < 10) {
            m = "0" + m
        }
        var nowMonth = y + "-" + m
        queryMonthLog(nowMonth)    //查询当前月记录
    }

    /*查询商户提现记录*/
    function queryMonthLog(month) {
        $.post(getWeiContextPath() + "/wx/shop/queryMonthLog", {shopId: shopId,month:month}, function (res) {

            if(res.code==0){
                var _pickList=$('#pickList').empty()
                $.each(res.data,function(i,obj){
                    if (obj.belongType==1){
                        var str4 = obj.bankNum.substring(obj.bankNum.length-4,obj.bankNum.length);
                        _pickList.append('<div class="order-item flex" >\n' +
                            '            <div class="image-contain  iconfont icon-xiaofei"></div>\n' +
                            '            <div class="flex column">\n' +
                            '                <div class="flex between top-info">\n' +
                            '                    <div class="name">提现到银行卡('+str4+')</div>\n' +
                            '                    <div class="cl-main">'+obj.pickMoney+'元</div>\n' +
                            '                </div>\n' +
                            '                <div class="flex between btm-info">\n' +
                            '                    <div>'+obj.createTime+'</div>\n' +
                            '                    <div>已完成</div>\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            '        </div>')
                    } else {
                        _pickList.append('<div class="order-item flex" >\n' +
                            '            <div class="image-contain  iconfont icon-xiaofei"></div>\n' +
                            '            <div class="flex column">\n' +
                            '                <div class="flex between top-info">\n' +
                            '                    <div class="name">提现到零钱</div>\n' +
                            '                    <div class="cl-main">￥'+obj.pickMoney+'</div>\n' +
                            '                </div>\n' +
                            '                <div class="flex between btm-info">\n' +
                            '                    <div>'+obj.createTime+'</div>\n' +
                            '                    <div>已完成</div>\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            '        </div>')
                    }

                })
            }
        })
    }
</script>

</html>